package com.metal.gear.certification.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.metal.gear.ClientV4;
import com.metal.gear.certification.entity.dto.depart.SysDepartSaveAndEditDto;
import com.metal.gear.certification.entity.model.DepartIdModel;
import com.metal.gear.certification.entity.model.SysDepartTreeModel;
import com.metal.gear.certification.entity.po.SysDepart;
import com.metal.gear.certification.entity.po.SysUser;
import com.metal.gear.certification.entity.vo.dept.SysDepartTreeVo;
import com.metal.gear.certification.service.ISysDepartService;
import com.metal.gear.certification.service.ISysUserService;
import com.metal.gear.common.constant.CacheConstant;
import com.metal.gear.common.constant.CommonConstant;
import com.metal.gear.common.entity.Result;
import com.metal.gear.common.exception.SzlBusinessException;
import com.metal.gear.common.util.tree.SzlTreeUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static com.metal.gear.demo.V4OkHttpClientTest.test;
import static com.metal.gear.service.v4.api.ChatApiService.defaultObjectMapper;


@Tag(name = "chatdemo")
@RestController
@RequestMapping("/chat")
@Slf4j
public class ChatDemoController {

    private static final String API_KEY = "c2e55ef666f32ffc2372c92abff1f467.vvnXw89O6VIJI5dz";



    @Operation(summary = "demo")
    @ApiOperationSupport(order = 1)
    @GetMapping(value = "/demo", produces = {MediaType.APPLICATION_JSON_VALUE})
    public Result<Object> chat() {
        try {
            test();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return Result.ok();
    }



}
